package wave.common.pojo.entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.core.keygen.KeyGenerators;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author 夕下风波
 * @date 2024-12-03 22:56
 * @description 基础实体
 */
@Data
public class BaseEntity {

    @Id(keyType = KeyType.Generator, value = KeyGenerators.snowFlakeId)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @Column(onInsertValue = "current_timestamp")
    private LocalDateTime createTime;

    @Column(onInsertValue = "current_timestamp")
    private LocalDateTime updateTime;

    private Long createUser;

    private Long updateUser;

    private String remark;

    @Column(isLogicDelete = true)
    private Integer isDelete;

}
